// JavaScript Document

~function(){
	window.wapAlert=function(content,successFn,cancelFn){
		successFn=successFn||function(){};
		
		var $alert=$("<div class='wapAlert-manager-layer'>\
						<table><tr><td>\
							<div class='wapAlert-Main'>\
								<div class='AM-content'>"+content+"</div>\
								<div class='AM-button'>\
									<a class='ok' href='javascript:;'>确定</a>\
								</div>\
							</div>\
						</td></tr></table>\
					</div>");
			
		
		$("body").append($alert);
		
		
		if(arguments.length>2){
			$alert.find(".AM-button").prepend("<a class='no' href='javascript:;'>取消</a>");	
		}
		
		//确定
		$alert.find(".AM-button .ok").click(function(){
			successFn();
			
			$alert.remove();
		});
		
		//取消
		$alert.find(".AM-button .no").click(function(){
			cancelFn();
			
			$alert.remove();
		});
	};
	
	window.wapLoading={
		loadBox:Object,
		show:function(){
			wapLoading.loadBox=$("<div class='wapLoading-manager-layer'></div>");
			
			$("body").append(wapLoading.loadBox);
			
			
		},
		hide:function(){
			wapLoading.loadBox.remove();
		}	
	};
		
}();